package com.example.demo.test;

import java.util.*;

/**
 * @Description
 * @Author chenhuiyu
 */
public class ListOfLists {
    public static void main(String[] args) {

        List<List<String>> listOfLists = new ArrayList<>();
        listOfLists.add(Arrays.asList("a", "b", "c", "1", "e"));
        listOfLists.add(Arrays.asList("1", "2", "3", "3", "5"));
        listOfLists.add(Arrays.asList("x", "y", "z", "2", "v"));

        System.out.println("Before sorting: " + listOfLists);

        listOfLists.sort(Comparator.comparing(list -> list.get(3)));

        System.out.println("After sorting: " + listOfLists);
    }
}


